<?php

?>
<table cellspacing="1" cellpadding="1" border="1" style="margin-top: 10px;margin-left:10px;">
	<tr>
		<td>course</td>
		<td>Average</td>
		<td>Differnce</td>
		<td>Cards</td>
		<td>1s</td>
		<td>2s</td>
		<td>3s</td>
		<td>4s</td>
		<td>5s</td>
	</tr>
	<?php 
		$prevId = -1;
		foreach($result as $course){
			if($prevId != $course->venue->venueid){
				printf("<tr><td colspan=\"9\"><strong>%s</strong></td></tr>",$course->venue->venuename);
			}
		?>
		<tr>
			<?php 
				printf("<td><a href=\"?%s&couseid=%s\">%s</a></td>",MenuItemEnum::COURSES,$course->courseid,$course->coursename);
				printf("<td>%s</td>",$course->average);
				printf("<td>%s</td>",$course->diff);
				printf("<td>%s</td>",$course->cards);
				printf("<td>%s</td>",$course->percentage1s);
				printf("<td>%s</td>",$course->percentage2s);
				printf("<td>%s</td>",$course->percentage3s);
				printf("<td>%s</td>",$course->percentage4s);
				printf("<td>%s</td>",$course->percentage5s);
				$prevId = $course->venue->venueid;
			?>	
		</tr>
	<?php }
	?>
</table>